/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-05-08 17:53:06
 * @LastEditors: icymoon911 icymoon911@163.com
 * @LastEditTime: 2024-08-08 16:09:00
 * @FilePath: \ken147258.topayClient\src\api\other\pay_product.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { ProductVO } from "./types";

const URL = {
  getUserInfo: '/user/getUserInfo',
  getGoogleCode: '/platformApi/google/code',
  getBind: '/platformApi/google/bind',

  manager_list: '/platformApi/user/list', // 管理员列表
  manager_add: '/platformApi/user/add', // 添加管理员
  manager_edit: '/platformApi/user/edit', // 编辑管理员
  manager_del: '/platformApi/user/del', // 删除管理员
};

export function getUserInfo(): AxiosPromise<any> {
  return request({
    url: URL.getUserInfo,
    method: "get",
  });
}

export function getGoogleCode(): AxiosPromise<any> {
  return request({
    url: URL.getGoogleCode,
    method: "get",
  });
}

export function getBind(data: object): AxiosPromise<any> {
  return request({
    url: URL.getBind,
    method: "post",
    data: data,
  });
}


// 管理员列表
export function manager_list(data: object): AxiosPromise<any> {
  return request({
    url: URL.manager_list,
    method: "get",
    params: data,
  });
}

// 添加管理员
export function manager_add(data: object): AxiosPromise<any> {
  return request({
    url: URL.manager_add,
    method: "post",
    data: data,
  });
}

// 编辑管理员
export function manager_edit(data: object): AxiosPromise<any> {
  return request({
    url: URL.manager_edit,
    method: "post",
    data: data,
  });
}

// 删除管理员
export function manager_del(data: object): AxiosPromise<any> {
  return request({
    url: URL.manager_del,
    method: "get",
    params: data,
  });
}
